package unitTest;

import java.rmi.RemoteException;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import vo.StructureVO;

import StructureBL.StructureController;
import junit.framework.TestCase;

public class StructureTest extends TestCase{
	private StructureController sc;
	
	@Before
    public void setUp() throws Exception {
		sc=new StructureController();
    }

    @After
    public void tearDown() throws Exception {
    }
	
	@Test
	public void testStructure(){
		StructureVO sv=new StructureVO();
		StructureVO struc=new StructureVO();
		sv.Commmon=150;
		sv.Profession=100;
		sv.require=50;
		sv.total=260;
		
		try {
			sc.setStructure(sv);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			struc=sc.getStructure();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Assert.assertEquals(sv.total, struc.total);
	}
}
